package kernel.util;

/**
 * @author Shentian Yu 2008-7-30
 *
 */
public class ThreadUtils {
    private static ThreadLocal<?> localVar;

    @SuppressWarnings("unchecked")
    public static <T> T getThreadLocal() {
        if (localVar == null) {
            localVar = new ThreadLocal<T>();
        }
        return (T) localVar;
    }

    public static void sleep(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

}
